/*    */ package net.sourceforge.appgen.generator;
/*    */ 
/*    */ import java.io.File;
/*    */ import net.sourceforge.appgen.model.ConnectionInformation;
/*    */ import net.sourceforge.appgen.model.Entity;
/*    */ import net.sourceforge.appgen.model.GenerationInformation;
/*    */ import net.sourceforge.appgen.util.FileUtils;
/*    */ 
/*    */ public class JdbcDriverFileGenerator extends OnceFileGenerator
/*    */ {
/*    */   private ConnectionInformation connectionInformation;
/*    */ 
/*    */   public JdbcDriverFileGenerator(GenerationInformation generationInformation, ConnectionInformation connectionInformation)
/*    */   {
/* 34 */     super(generationInformation);
/*    */ 
/* 36 */     this.connectionInformation = connectionInformation;
/*    */   }
/*    */ 
/*    */   public File generateFile(Entity entity, File in, File out) throws Exception {
/* 40 */     FileUtils.copy(in, out);
/*    */ 
/* 42 */     return out;
/*    */   }
/*    */ 
/*    */   public File generate(Entity entity) throws Exception
/*    */   {
/* 47 */     if (!this.aleradyGenerate) {
/* 48 */       this.aleradyGenerate = true;
/*    */ 
/* 51 */       return generateFile(entity, this.connectionInformation.getDriverFile(), getFile(entity));
/*    */     }
/*    */ 
/* 54 */     return null;
/*    */   }
/*    */ 
/*    */   public File getFile(Entity entity)
/*    */   {
/* 60 */     return new File(getDirectory(), this.connectionInformation.getDriverFile().getName());
/*    */   }
/*    */ 
/*    */   public File getDirectory()
/*    */   {
/* 65 */     return new File(this.outputDir.getPath() + File.separator + "WebContent" + File.separator + "WEB-INF" + File.separator + "lib");
/*    */   }
/*    */ 
/*    */   public String getTemplate()
/*    */   {
/* 70 */     return null;
/*    */   }
/*    */ }

/* Location:           C:\Users\lzl6066\Downloads\net.sourceforge.appgen_1.2.0\plugins\net.sourceforge.appgen_1.2.0.201002031718\
 * Qualified Name:     net.sourceforge.appgen.generator.JdbcDriverFileGenerator
 * JD-Core Version:    0.6.0
 */